var cid = "{$sid}"*1;
    var cat_id = "{$cat_id}"*1;
    (function ( window, undefined ) {
  
  "use strict";

  var GH = function () {};
  
  GH.prototype.$ = function( selector ) {
    var isId = new RegExp( /^#\w+$/ ).test( selector );
    return isId ? document.getElementById ( selector.replace( /^#/g, "" ) ) : document.querySelector ( selector );
  };
  
  GH.prototype.$$ = function( selector ) {
    return document.querySelectorAll ( selector );
  };
  
  GH.prototype.load = function ( type, id, url, callback ) {
    var obj = document.getElementById( id );
    try {
      obj.parentNode.removeChild( obj )
    } catch (e) {

    }

    var insertEle = null;
    if( !type || type == "js" ) {
      insertEle = document.createElement("script");
      insertEle.setAttribute("type", "text/javascript");
      insertEle.setAttribute("src", url);
    } else if ( type == "css" ) {
      insertEle = document.createElement("link");
      insertEle.setAttribute("rel", "stylesheet");
      insertEle.setAttribute("href", url);
    }
    
    insertEle.setAttribute("id", id);
    insertEle.setAttribute("charset", "utf-8");
    
    document.getElementsByTagName("head")[0].appendChild( insertEle );
    insertEle.onload = function() {
      callback && callback();
    }
  };

  GH.prototype.css = function ( obj, attr, value ) {
    switch( arguments.length ) {
      case 2: 
        if ( typeof arguments[1] === "string" ) {
          return getComputedStyle ( obj, false ) [ attr ]; //1
        } else {
          for ( var i in arguments[1] ) { obj.style[i] = attr[i]; } //3
        }
        break;
      case 3:
        obj.style[attr] = value; //2
        break;
      default:
        break;
      };
  };


  GH.prototype.showMessage = function ( message ) {
    var self = this;
    var container = document.createElement( "div" );
    var inner = document.createElement( "span" );
    inner.innerHTML = message;
    this.css(container, {
      position: "fixed", top: "50%", left: "50%",
      width: "100%", maxWidth: "90%",
      WebkitTransform: "translate(-50%,-50%)", msTransform: "translate(-50%,-50%)", transform: "translate(-50%,-50%)",
      zIndex: 9999, borderRadius: "2px",
      transition: "opacity 0.5s ease-in-out",
      WebkitTransition: "opacity 0.5s ease-in-out",
      MsTransition: "opacity 0.5s ease-in-out",
      wordBreak: "break-word",
      textAlign: "center"
    });
    this.css(inner, {
      display: "inline-block",
      padding: ".8em 1em",
      backgroundColor: "rgba(51,51,51,.8)", 
      color: "#fff", textAlign: "left"
    });
    container.appendChild( inner );
    document.body.appendChild( container );
    setTimeout( function(){ 
      self.css( container, { opacity: 0 } );
      setTimeout( function(){ document.body.removeChild( container ) }, 500);
    }, 2000 );
  };
  window.GH = new GH();
})( window );

Date.prototype.Format = function (fmt) { //author: meizz 
    var o = {
        "M+": this.getMonth() + 1, //月份 
        "d+": this.getDate(), //日 
        "h+": this.getHours(), //小时 
        "m+": this.getMinutes(), //分 
        "s+": this.getSeconds(), //秒 
        "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
        "S": this.getMilliseconds() //毫秒 
    };
    if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    for (var k in o)
    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    return fmt;
}